import request from "utils/http";
import baseURL from "./baseUrlConfig";

export function Version(data) {
  return request({
    // baseURL: baseURL.host,
    url: '/api/version',
    method: 'get',
    data: data
  })
}

// 微信授权登录
export function WechatAuth(data) {
  return request({
    // baseURL: baseURL.host,
    url: '/api/wechatauth',
    method: 'post',
    data: data
  })
}

export function Login(data) {
  return request({
    // baseURL: baseURL.host,
    url: '/api/login',
    method: 'post',
    data: data
  })
}

export function Logout(data) {
  return request({
    // baseURL: baseURL.host,
    url: '/api/logout',
    method: 'post',
    data: data
  })
}


export function SendSms(data) {
  return request({
    // baseURL: baseURL.host,
    url: '/api/sendsms',
    method: 'post',
    data: data
  })
}

// 校验短信
export function CheckCaptcha(data) {
  return request({
    // baseURL: baseURL.host,
    url: '/api/check_captcha',
    method: 'post',
    data: data
  })
}


export function BindPhone(data) {
  return request({
    // baseURL: baseURL.host,
    url: '/api/bindphone',
    method: 'post',
    data: data
  })
}

// 设置密码，或忘记密码重置密码
export function SetPassword(data) {
  return request({
    // baseURL: baseURL.host,
    url: '/api/setpassword',
    method: 'post',
    data: data
  })
}

// 修改密码
export function ResetPassword(data) {
  return request({
    // baseURL: baseURL.host,
    url: '/api/user/resetpassword',
    method: 'post',
    data: data
  })
}

export function UserInfo(data) {
  return request({
    // baseURL: baseURL.host,
    url: '/api/user/info',
    method: 'get',
    data: data
  })
}

// 激活码校验
export function CheckActivated(data) {
  return request({
    // baseURL: baseURL.host,
    url: '/api/activacode/check',
    method: 'post',
    data: data,
    'no-TipError': true,
  })
}

// 油卡充值卡列表
export function RechargeCardList(data) {
  return request({
    // baseURL: baseURL.host,
    url: '/api/recharge/cardlist',
    method: 'get',
    data: data,
  })
}

export function WebInfo(data) {
  return request({
    // baseURL: baseURL.host,
    url: '/api/webinfo/read',
    method: 'get',
    data: data,
  })
}